package in.wenwen.controller;

import in.wenwen.entity.Article;
import in.wenwen.service.IArticleService;

import org.jiucheng.ioc.annotation.Inject;
import org.jiucheng.log.Logger;
import org.jiucheng.web.annotation.Controller;
import org.jiucheng.web.annotation.Controller.GET;

@Controller
public class TestController {
    
    private static final Logger log = Logger.getLogger(TestController.class);
    
    @Inject
    private IArticleService articleService;
    
    public TestController() {
        log.info("构造器");
    }
    
    @GET("/test/([0-9]+)")
    public Article test(String[] args) {
        Article article = articleService.get(Article.class, Long.parseLong(args[1]));
        return article;
    }
}
